/**
 * Copyright 2007 American Well Systems
 * All rights reserved.
 *
 * It is illegal to use, reproduce or distribute
 * any part of this Intellectual Property without
 * prior written authorization from American Well.
 */
package org.windowkit.toolkit.widget.table.render;

import java.text.NumberFormat;

import javax.swing.SwingConstants;
import javax.swing.table.DefaultTableCellRenderer;

/**
 * Table cell renderer for Longs.
 */
public class LongRenderer extends DefaultTableCellRenderer {

	/**
	 *
	 */
	private static final long serialVersionUID = -6787560531477520850L;

	/**
	 * Constructor.
	 */
	public LongRenderer() {
		setHorizontalAlignment(SwingConstants.RIGHT);
	}

	/**
	 * {@inheritDoc}
	 */
	@Override
	protected void setValue(final Object value) {
		setText((value == null) ? "" : NumberFormat.getInstance().format(value));
	}

}